<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li ><a href="javascript:history.back(-1);">视频列表</a></li>
			<li class="active"><a >{:lang('EDIT')}</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('Video/editPost')}">
            <div class="form-group">
				<label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>分类</label>
				<div class="col-md-6 col-sm-10">
					<select class="form-control" name="classid">
                        <volist name="class" id="v">
                        <option value="{$v['id']}" <eq name="data['classid']" value="$v['id']">selected</eq>>{$v['name']}</option>
                        </volist>
                    </select>
				</div>
			</div>
            
            <div class="form-group">
				<label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>用户</label>
				<div class="col-md-6 col-sm-10" style="padding-top:7px;">
					{$data['userinfo']['user_nicename']} ({$data['uid']})
				</div>
			</div>
            
            <div class="form-group">
				<label for="input-title" class="col-sm-2 control-label"><span class="form-required"></span>标题</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-title" name="title" value="{$data['title']}">
				</div>
			</div>
            
            <div class="form-group">
				<label for="input-user_login" class="col-sm-2 control-label"><span class="form-required">*</span>图片</label>
				<div class="col-md-6 col-sm-10">
					<input type="hidden" name="thumb" id="thumbnail" value="{$data['thumb']}">
                    <a href="javascript:uploadOneImage('图片上传','#thumbnail');">
                        <if condition="empty($data.thumb)">
                        <img src="__TMPL__/public/assets/images/default-thumbnail.png"
                                 id="thumbnail-preview"
                                 style="cursor: pointer;max-width:100px;max-height:100px;"/>
                        <else/>
                        <img src="{:get_upload_path($data.thumb)}"
                             id="thumbnail-preview"
                             style="cursor: pointer;max-width:100px;max-height:100px;"/>
                        </if>
                    </a>
                    <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片"> 
				</div>
			</div>
            
            <div class="form-group">
				<label for="input-href" class="col-sm-2 control-label"><span class="form-required">*</span>上传视频</label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" id="js-file-input" type="text" name="href" value="{$data['href']}" style="width: 300px;display: inline-block;" title="文件名称">
                        <a href="javascript:uploadOne('文件上传','#js-file-input','video');">上传文件</a>MP4格式
				</div>
			</div>
            
            <div class="form-group">
				<label for="input-href_w" class="col-sm-2 control-label"><span class="form-required">*</span>上传水印视频</label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" id="js-file-input2" type="text" name="href_w" value="{$data['href_w']}" style="width: 300px;display: inline-block;" title="文件名称">
                        <a href="javascript:uploadOne('文件上传','#js-file-input2','video');">上传文件</a>MP4格式
				</div>
			</div>
			
			
			<if condition="!empty($goodsinfo)">
				
				<div class="form-group" >
					<label for="input-type_name" class="col-sm-2 control-label">商品类型</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control" id="input-type_name"  value="{$goodsinfo['type_name']}" readonly="readonly" />
					</div>
				</div>


				<div class="form-group" >
					<label for="input-name" class="col-sm-2 control-label">商品名称</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control" id="input-name"  value="{$goodsinfo['name']}" readonly="readonly" />
					</div>
				</div>
				
				
				<div class="form-group" >
					<label for="input-goods_thumb" class="col-sm-2 control-label">商品封面</label>
					<div class="col-md-6 col-sm-10">
						<img src="{:get_upload_path($goodsinfo['thumb'])}" class="imgtip" style="max-width:150px;max-height:150px;"/>
					</div>
				</div>

				<div class="form-group" >
					<label for="input-goods_href" class="col-sm-2 control-label">商品链接</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control" id="input-goods_href"  value="{$goodsinfo['href']}" readonly="readonly" />
					</div>
				</div>

				<div class="form-group" >
					<label for="input-old_price" class="col-sm-2 control-label">商品原价</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control" id="input-old_price"  value="{$goodsinfo['old_price']}" readonly="readonly" />
					</div>
				</div>

				<div class="form-group" >
					<label for="input-price" class="col-sm-2 control-label">商品现价</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control" id="input-price"  value="{$goodsinfo['price']}" readonly="readonly" />
					</div>
				</div>

				<div class="form-group" >
					<label for="input-goods_desc" class="col-sm-2 control-label">商品简介</label>
					<div class="col-md-6 col-sm-10">
						<textarea class="form-control"  rows="2" cols="20"  readonly="readonly">{$goodsinfo['des']}</textarea>
					</div>
				</div>

				<div class="form-group" >
					<label for="input-goods_addtime" class="col-sm-2 control-label">商品添加时间</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control"  value="{:date('Y-m-d H:i:s',$goodsinfo['addtime'])}" readonly="readonly" />
					</div>
				</div>


			</if>
            

            <div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<input type="hidden" name="id" value="{$data.id}" />
					<input type="hidden" name="thumb_old" value="{$data.thumb}" />
					<input type="hidden" name="href_old" value="{$data.href}" />
					<input type="hidden" name="href_w_old" value="{$data.href_w}" />
					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('EDIT')}</button>
					<a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
				</div>
			</div>

		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
    <script type="text/javascript">
        (function(){
            $('.btn-cancel-thumbnail').click(function () {
                $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
                $('#thumbnail').val('');
            });
        })()

    </script>
</body>
</html>
